
package cn.edu.scau.cmi.hombio.web.rest;

import org.junit.Test;

import org.junit.runner.RunWith;

import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.beans.factory.support.DefaultListableBeanFactory;

import org.springframework.context.ApplicationContext;

import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.mock.web.MockHttpServletResponse;

import org.springframework.test.context.ContextConfiguration;

import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.RequestScope;
import org.springframework.web.context.request.ServletRequestAttributes;
import org.springframework.web.context.request.SessionScope;

/**
 * Unit test for the <code>CureMethodRestController</code> controller.
 *
 * @see cn.edu.scau.cmi.hombio.web.rest.CureMethodRestController
 */
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {
		"file:./resources/pigRs-security-context.xml",
		"file:./resources/pigRs-service-context.xml",
		"file:./resources/pigRs-dao-context.xml",
		"file:./resources/pigRs-web-context.xml" })
public class CureMethodRestControllerTest {
	/**
	 * The Spring application context.
	 *
	 */
	private ApplicationContext context;

	/**
	 * Test <code>CureMethodcuremethod_idcureTaskCourse()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetCureMethodcuremethod_idcureTaskCourse() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/CureMethod/{curemethod_id}/cureTaskCourse");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		CureMethodRestController controller = (CureMethodRestController) context.getBean("CureMethodRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>CureMethodcuremethod_idcureTaskCourse()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void PostCureMethodcuremethod_idcureTaskCourse() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/CureMethod/{curemethod_id}/cureTaskCourse");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		CureMethodRestController controller = (CureMethodRestController) context.getBean("CureMethodRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>CureMethodcuremethod_idcureTaskCourse()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void PutCureMethodcuremethod_idcureTaskCourse() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/CureMethod/{curemethod_id}/cureTaskCourse");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		CureMethodRestController controller = (CureMethodRestController) context.getBean("CureMethodRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>CureMethodcuremethod_idcureTaskCoursecuretaskcourse_id()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void DeleteCureMethodcuremethod_idcureTaskCoursecuretaskcourse_id() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/CureMethod/{curemethod_id}/cureTaskCourse/{curetaskcourse_id}");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		CureMethodRestController controller = (CureMethodRestController) context.getBean("CureMethodRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>CureMethodcuremethod_idcureTaskCoursecuretaskcourse_id()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetCureMethodcuremethod_idcureTaskCoursecuretaskcourse_id() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/CureMethod/{curemethod_id}/cureTaskCourse/{curetaskcourse_id}");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		CureMethodRestController controller = (CureMethodRestController) context.getBean("CureMethodRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>CureMethodcuremethod_idcureType()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetCureMethodcuremethod_idcureType() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/CureMethod/{curemethod_id}/cureType");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		CureMethodRestController controller = (CureMethodRestController) context.getBean("CureMethodRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>CureMethodcuremethod_idcureType()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void PostCureMethodcuremethod_idcureType() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/CureMethod/{curemethod_id}/cureType");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		CureMethodRestController controller = (CureMethodRestController) context.getBean("CureMethodRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>CureMethodcuremethod_idcureType()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void PutCureMethodcuremethod_idcureType() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/CureMethod/{curemethod_id}/cureType");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		CureMethodRestController controller = (CureMethodRestController) context.getBean("CureMethodRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>CureMethodcuremethod_idcureTypecuretype_id()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void DeleteCureMethodcuremethod_idcureTypecuretype_id() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/CureMethod/{curemethod_id}/cureType/{curetype_id}");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		CureMethodRestController controller = (CureMethodRestController) context.getBean("CureMethodRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>CureMethodcuremethod_idcureTypecuretype_id()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetCureMethodcuremethod_idcureTypecuretype_id() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/CureMethod/{curemethod_id}/cureType/{curetype_id}");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		CureMethodRestController controller = (CureMethodRestController) context.getBean("CureMethodRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>CureMethodcuremethod_idcureMedicines()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetCureMethodcuremethod_idcureMedicines() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/CureMethod/{curemethod_id}/cureMedicines");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		CureMethodRestController controller = (CureMethodRestController) context.getBean("CureMethodRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>CureMethodcuremethod_idcureMedicines()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void PostCureMethodcuremethod_idcureMedicines() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/CureMethod/{curemethod_id}/cureMedicines");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		CureMethodRestController controller = (CureMethodRestController) context.getBean("CureMethodRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>CureMethodcuremethod_idcureMedicines()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void PutCureMethodcuremethod_idcureMedicines() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/CureMethod/{curemethod_id}/cureMedicines");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		CureMethodRestController controller = (CureMethodRestController) context.getBean("CureMethodRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>CureMethodcuremethod_idcureMedicinescuremedicine_id()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void DeleteCureMethodcuremethod_idcureMedicinescuremedicine_id() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/CureMethod/{curemethod_id}/cureMedicines/{curemedicine_id}");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		CureMethodRestController controller = (CureMethodRestController) context.getBean("CureMethodRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>CureMethodcuremethod_idcureMedicinescuremedicine_id()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetCureMethodcuremethod_idcureMedicinescuremedicine_id() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/CureMethod/{curemethod_id}/cureMedicines/{curemedicine_id}");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		CureMethodRestController controller = (CureMethodRestController) context.getBean("CureMethodRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>CureMethod()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetCureMethod() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/CureMethod");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		CureMethodRestController controller = (CureMethodRestController) context.getBean("CureMethodRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>CureMethodcuremethod_id()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetCureMethodcuremethod_id() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/CureMethod/{curemethod_id}");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		CureMethodRestController controller = (CureMethodRestController) context.getBean("CureMethodRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>CureMethod()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void PutCureMethod() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/CureMethod");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		CureMethodRestController controller = (CureMethodRestController) context.getBean("CureMethodRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>CureMethod()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void PostCureMethod() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/CureMethod");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		CureMethodRestController controller = (CureMethodRestController) context.getBean("CureMethodRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>CureMethodcuremethod_id()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void DeleteCureMethodcuremethod_id() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/CureMethod/{curemethod_id}");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		CureMethodRestController controller = (CureMethodRestController) context.getBean("CureMethodRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Autowired to set the Spring application context.
	 *
	 */
	@Autowired
	public void setContext(ApplicationContext context) {
		this.context = context;
		((DefaultListableBeanFactory) context.getAutowireCapableBeanFactory()).registerScope("session", new SessionScope());
		((DefaultListableBeanFactory) context.getAutowireCapableBeanFactory()).registerScope("request", new RequestScope());
	}

	/**
	 * Returns a mock HttpServletRequest object.
	 *
	 */
	private MockHttpServletRequest getMockHttpServletRequest() {
		MockHttpServletRequest request = new MockHttpServletRequest();
		ServletRequestAttributes attributes = new ServletRequestAttributes(request);
		RequestContextHolder.setRequestAttributes(attributes);
		return request;
	}

	/**
	 * Returns a mock HttpServletResponse object.
	 *
	 */
	private MockHttpServletResponse getMockHttpServletResponse() {
		return new MockHttpServletResponse();
	}
}